<%--
  Created by IntelliJ IDEA.
  User: Rui
  Date: 2018/9/8
  Time: 9:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html style="background-color: #fff;">
<head>
    <%@include file="../../../../resources/inc/head.jsp" %>
    <style>
         .option-tips .full-width-97{
             width: 97%;
         }
        .layer-box   .layui-layer-content{
            padding: 10px;
        }
    </style>
</head>
<body>
<div class="layui-form common-form" lay-filter="layuiadmin-form-paymentChannel" id="layuiadmin-form-paymentChannel"
     style="padding: 20px;">

    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>支付渠道名称</th>
            <th>应用场景</th>
            <th>费率</th>
            <th>结算周期</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${paymentChannels}" var="paymentChannel">
            <tr>
                <td>${paymentChannel.name}</td>
                <td>${paymentChannel.useCase}</td>
                <td>${paymentChannel.payRate}%</td>
                <td>${paymentChannel.settlementCycle}</td>
                <%--${weixinSignStatus!=10||paymentChannel.type!=2?'微信签约未通过':}--%>
                <td>${weixinSignStatus!=10&&paymentChannel.type!=2?'微信签约未通过':paymentChannel.verify==true?'<span class="layui-badge layui-bg-green">已开通</span>':'<span class="layui-badge">未开通</span>'}</td>
                <td>
                    <c:if test="${weixinSignStatus==10&&paymentChannel.type==2}">
                    <c:if test="${!paymentChannel.verify}">
                        <a class="app layui-btn layui-btn-warm layui-btn-xs" id="${paymentChannel.id}" lay-event="app">参数配置</a>
                    </c:if>
                    <c:if test="${paymentChannel.verify}">
                        <a class="appInfo layui-btn  layui-btn-xs" id="${paymentChannel.id}" lay-event="app" >查看参数</a>
                    </c:if>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-submit" id="LAY-submit" value="确认">
    </div>
</div>

<%@include file="../../../../resources/inc/footer.jsp" %>
<script>
    layui.config({
        base: '<%=basePath%>resources/lib/layuiAdmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'upload'], function () {
        var $ = layui.$
            , form = layui.form
            , upload = layui.upload;
        $(".appInfo").click(function () {
            var id = $(this).attr("id");
            var merchantNo="${merchantApplication.merchantNo}";
            $.ajax({
                type: "get",
                url: '<%=basePath%>manager/merchant/applicationConfig/getConfig/'+id+'.html?merchantNo='+merchantNo,
                dataType:'json',
                success: function (data) {
                    layer.open({
                        type: 1,
                        title: false,
                        closeBtn: 0,
                        shadeClose: true,
                        skin: 'yourclass',
                        content: " <div class=\"layui-form-item\">\n" +
                            "        <label class=\"layui-form-label\">商户号</label>\n" +
                            "        <div class=\"layui-input-inline\">\n" +
                            "            <input  class=\"layui-input\" disabled type=\"text\" value="+data.merchantNo+">\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "    <div class=\"layui-form-item\">\n" +
                            "        <label class=\"layui-form-label\">appId</label>\n" +
                            "        <div class=\"layui-input-inline\">\n" +
                            "            <input  class=\"layui-input\"disabled type=\"text\" value="+data.appId+">\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "    <div class=\"layui-form-item\">\n" +
                            "        <label class=\"layui-form-label\">mchId</label>\n" +
                            "        <div class=\"layui-input-inline\">\n" +
                            "            <input class=\"layui-input\"disabled type=\"text\" value="+data.mchId+">\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "    <div class=\"layui-form-item\">\n" +
                            "        <label class=\"layui-form-label\">私钥</label>\n" +
                            "        <div class=\"layui-input-inline\">\n" +
                            "            <input class=\"layui-input\"disabled type=\"text\" value="+data.privateKey+">\n" +
                            "        </div>\n" +
                            "    </div>"
                    });
                }
            })
        })
        $(".app").click(function () {
            var id = $(this).attr("id");
            var dialog = new UtilClass.LayerDialog({
                title: "配置",
                content: '<%=basePath%>manager/merchant/applicationConfig/addConfig/' + id + '.html?' + 'merchantApplicationId=' + "${merchantApplication.id}",
            });
            dialog.layerShow();

        })
    })


</script>
</body>
</html>
